//1.
class Solution {
public:
    int removeElement(vector<int>& nums, int val) {
        int n = nums.size();
        int slow = 0, fast = 0;
        while(fast < n) {
            if(nums[fast]!=val) {
                swap(nums[slow], nums[fast]);
               slow++;
            }
            fast++;
                
        }
        return slow;
    }
};